package com.karaoke.android.data.domain

/**
 * Created by Allen on 16/7/7.
 */
class QSong
{
    var page: Int = 1
    var size: Int = 72
    var criteria: Any? = null
    var keyword: String? = null
    var typeId: Int = 0
    var queryType: QueryType = QueryType.QUERY_LANGUAGE

    enum class QueryType
    {
        QUERY_SINGER,
        QUERY_LANGUAGE,
        QUERY_NEW,
        QUERY_WORD_COUNT,
        QUERY_SONG_TYPE,
        QUERY_SEARCH,
        QUERY_RECOMMEND
    }


    override fun hashCode(): Int
    {
        var result = page
        result = 31 * result + size
        result = 31 * result + (criteria?.hashCode() ?: 0)
        result = 31 * result + (keyword?.hashCode() ?: 0)
        result = 31 * result + queryType.hashCode()
        return result
    }

    override fun equals(other: Any?): Boolean
    {
        if (this === other) return true
        if (other?.javaClass != javaClass) return false

        other as QSong

        if (page != other.page) return false
        if (size != other.size) return false
        if (criteria != other.criteria) return false
        if (keyword != other.keyword) return false
        if (queryType != other.queryType) return false

        return true
    }


}
